package com.liangzhong.model.playerCenter.vo
{
	import mx.charts.AreaChart;

	/**
	 *训练阵型坐标 
	 * @author Administrator
	 * 
	 */	
	public class TrainingTacticsVo
	{
		public function TrainingTacticsVo()
		{
			_allArr = [];
		}
		/**
		 * 阵形ID
		 * 1 -->433
		 * 2 -->343
		 * 3 -->442
		 * 4 -->451
		 * 5 -->532
		 * 6 -->541
		 **/
		private var _tid:int;
		private var _tname:int;
		/**
		 * 守门员
		 */
		private var _GK:Array;
		/**
		 * 后卫
		 */
		private var _DF:Array;
		/**
		 * 中场
		 */
		private var _MF:Array;
		/**
		 * 前锋
		 */
		private var _FW:Array;
		/**
		 *所有类型的 
		 */
		private var _allArr:Array;
		/**
		 *解析数据 
		 * @param $xmlList
		 * 
		 */
		public function analysisData($xml:XML):void
		{
			var xmlList:XMLList = $xml.children();
			for each(var xml:XML in xmlList)
			{
				this[xml.localName()] = xml.toString();
			}
		}
		
		public function set gk(value:String):void
		{
			_GK = stringToArray(value);
			_allArr = _allArr.concat(_GK);
		}
		public function get GK():Array
		{
			return _GK
		}
		public function set df(value:String):void
		{
			_DF = stringToArray(value);
			_allArr =_allArr.concat(_DF);
		}
		public function get DF():Array
		{
			return _DF;
		}
		public function set mf($str:String):void
		{
			_MF = stringToArray($str);
			_allArr =_allArr.concat(_MF);
		}
		public function get MF():Array
		{
			return _MF
		}
		public function set fw($str:String):void
		{
			_FW = stringToArray($str);
			_allArr =_allArr.concat(_FW);
		}
		public function get FW():Array
		{
			return _FW;
		}
		public function get allArr():Array
		{
			return _allArr;
		}
		/**
		 * 阵型的ID 
		 * @return 
		 * 
		 */
		public function get tid():int
		{
			return _tid;
		}

		public function set tid(value:int):void
		{
			_tid = value;
		}

		/**
		 *阵型名字 
		 */
		public function get tname():int
		{
			return _tname;
		}

		/**
		 * @private
		 */
		public function set tname(value:int):void
		{
			_tname = value;
		}
		/**
		 *字符转数组 
		 * @param $str
		 * @return 
		 * 
		 */
		private function stringToArray($str:String):Array
		{
			var arr:Array = $str.split(/\|/g);
			var len:int = arr.length;
			var tempArr:Array = [];
			var str:String;
			for(var i:int = 0;i < len;i++)
			{
				tempArr.push(strToXY(arr[i]));
			}
			return tempArr;
		}
		private function strToXY($str:String):Object
		{
			var arr:Array = $str.split(/\,/g);
			var obj:Object = {};
			obj.fx = arr[0];
			obj.fy = arr[1];
			return obj;
		}

	}
}